var ftpd = require('./ftp.js');

var server = ftpd.createServer("139.199.88.165", "/data/home/www/ftp");
server.on("connection", function(socket) {
    var username = null;
    console.log("client connected: " + socket.remoteAddress);
    socket.on("command:user", function(user, success, failure) {
        if (user) {
            username = user;
            success();
        } else failure();
    });
    socket.on("command:pass", function(pass, success, failure) {
        if (pass) success(username);
        else failure();
    });
})
server.debugging = 4;
server.listen(7001);